package com.jpro.module.system.convert.membergroup;

import com.jpro.framework.common.pojo.PageResult;
import com.jpro.module.system.controller.admin.membergroup.vo.*;
import com.jpro.module.system.dal.dataobject.membergroup.MemberGroupDO;
import org.mapstruct.IterableMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Named;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 会员组 Convert
 *
 * @author jprocms
 */
@Mapper
public interface MemberGroupConvert {

    MemberGroupConvert INSTANCE = Mappers.getMapper(MemberGroupConvert.class);

    MemberGroupDO convert(MemberGroupCreateReqVO bean);

    MemberGroupDO convert(MemberGroupUpdateReqVO bean);

    MemberGroupRespVO convert(MemberGroupDO bean);

    @Named(value = "convertSimple")
    MemberGroupSimpleRespVO convertSimple(MemberGroupDO bean);

    List<MemberGroupRespVO> convertList(List<MemberGroupDO> list);

    @IterableMapping(qualifiedByName = "convertSimple")
    List<MemberGroupSimpleRespVO> convertSimpleList(List<MemberGroupDO> list);

    PageResult<MemberGroupRespVO> convertPage(PageResult<MemberGroupDO> page);

    List<MemberGroupExcelVO> convertList02(List<MemberGroupDO> list);

}
